package com.seveneight.baijiesteward.http;

import com.alibaba.fastjson.JSONObject;
import com.seveneight.baijiesteward.bean.AnyBean;
import com.seveneight.baijiesteward.bean.BankBean;
import com.seveneight.baijiesteward.bean.BaseEntity;
import com.seveneight.baijiesteward.bean.OrderBean;
import com.seveneight.baijiesteward.bean.ProfitBean;
import com.seveneight.baijiesteward.bean.UserBean;
import com.seveneight.baijiesteward.bean.VersionBean;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Headers;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;

/**
 * @author yemao
 * @date 2017/4/9
 * @description API接口!
 */

public interface APIFunction {

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.CHECK_IN)
    Observable<BaseEntity<UserBean>> login(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.USER_INFO)
    Observable<BaseEntity<UserBean>> getUserInfo(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.IDENTIFY)
    Observable<BaseEntity<UserBean>> startIdentify(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.GET_CODE)
    Observable<BaseEntity<AnyBean>> getCode(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.UPDATA_LOGINPWD)
    Observable<BaseEntity<AnyBean>> changeLoginPwd(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.UPDATA_DEALPWD)
    Observable<BaseEntity<AnyBean>> changeDealPwd(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.GET_BANK_LIST)
    Observable<BaseEntity<AnyBean>> getBankList(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.GET_MENU_LIST)
    Observable<BaseEntity<AnyBean>> getFirstMenu(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.ADD_CARD)
    Observable<BaseEntity<AnyBean>> addCard(@Body RequestBody body);

    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @POST(HttpConfig.EDIT_CARD)
    Observable<BaseEntity<AnyBean>> editCard(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.GET_CARDLIST)
    Observable<BaseEntity<AnyBean>> getCardList(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.GET_CREDITLIST)
    Observable<BaseEntity<AnyBean>> getCreditCardList(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.GET_SHAREIMG)
    Observable<BaseEntity<AnyBean>> getShareImg(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.GET_RANKLIST)
    Observable<BaseEntity<AnyBean>> getRankList(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.REMOVE_CARD)
    Observable<BaseEntity<AnyBean>> removeCard(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.UPDATE_INFO)
    Observable<BaseEntity<AnyBean>> updateInfo(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.SET_DEFAULT)
    Observable<BaseEntity<AnyBean>> setDefault(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.UPGRADE)
    Observable<BaseEntity<AnyBean>> upUserGrade(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.UPLODA_HEAD)
    Observable<BaseEntity<AnyBean>> uploadHead(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.CREATE_ORDER)
    Observable<BaseEntity<OrderBean>> createOrder(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.CREATE_ORDER)
    Observable<BaseEntity<OrderBean>> createCashOrder(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.GET_ORDERLIST)
    Observable<BaseEntity<AnyBean>> getOrderData(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.USER_CONFIG)
    Observable<BaseEntity<AnyBean>> getUserConfig(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.PROFIT)
    Observable<BaseEntity<AnyBean>> getProfitData(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.TEAMLIST)
    Observable<BaseEntity<AnyBean>> getTeamList(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.BRANCHBANK)
    Observable<BaseEntity<AnyBean>> getBranchBank(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.Module_INDEXLIST)
    Observable<BaseEntity<AnyBean>> getBranchIndexlist(@Body RequestBody body);
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.Module_UPCODE)
    Observable<BaseEntity<AnyBean>> getUpGrade(@Body RequestBody body);

    @POST(HttpConfig.Bank_CreditcardList)
    Observable<BaseEntity<AnyBean>> getCereditCard(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.Bank_UpdateCredit_Card)
    Observable<BaseEntity<AnyBean>> postCardDate(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.Bank_ADD_CreditCard)
    Observable<BaseEntity<AnyBean>> addCrediCard(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.Bank_Plain_RepayPlan)
    Observable<BaseEntity<AnyBean>> repayPlan(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.Bank_Plain_PlenList)
    Observable<BaseEntity<AnyBean>> getPlanList(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.Bank_Plain_Add_RepayPlan)
    Observable<BaseEntity<AnyBean>> addPayPlanList(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.Bank_Plain_Pay_DataInfo)
    Observable<BaseEntity<AnyBean>> payPlaninfo(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.Bank_Plain_Pay_Remove)
    Observable<BaseEntity<AnyBean>> payPlanRemove(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.Bank_Card_setDefault_Card)
    Observable<BaseEntity<AnyBean>> settingDefaultCard(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.Bank_Card_Remove_Card)
    Observable<BaseEntity<AnyBean>> removeCreditCard(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.Bank_Card_Lpply_BankList)
    Observable<BaseEntity<AnyBean>> getSelBankList(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.Bank_Card_BankTopList)
    Observable<BaseEntity<AnyBean>> getSelThemeList(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.Bank_Card_TagList)
    Observable<BaseEntity<AnyBean>> getCardTagList(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.Bank_Card_BankCaredList)
    Observable<BaseEntity<AnyBean>> getCradBankLsit(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.Bank_Card_BankCardDetail)
    Observable<BaseEntity<AnyBean>> getBankCardDetail(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.Bank_Card_ApplyBankCard)
    Observable<BaseEntity<AnyBean>> postApplyBankCard(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.Bank_Card_RepayPla_Detailn)
    Observable<BaseEntity<AnyBean>> postBankInfo(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.Bank_Card_Add_repay)
    Observable<BaseEntity<AnyBean>> postAddRepayBank(@Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(HttpConfig.Bank_Bind_CreditCard)
    Observable<BaseEntity<AnyBean>> getBindingCarditCard(@Body RequestBody body);

    @POST(HttpConfig.APPUPDATE)
    Observable<BaseEntity<VersionBean>> getVersionInfo();

    @POST(URLConfig.login_token_url)
    Call<String> loginByToken(@Query("mobile") String mobile, @Query("token") String cookie);

    //上传单张图片
    @Multipart
    @POST(HttpConfig.UPLOAD_IMG)
    Observable<Object> imageUpload(@Part("UserID") String UserID,
                                   @Part("ImageBusinessType") int ImageBusinessType,
                                   @Part() MultipartBody.Part img,
                                   @Part("Signature") String Signature);

    //上传多张图片
    @POST("服务器地址")
    Observable<Object> imagesUpload(@Part() List<MultipartBody.Part> imgs);
}
